Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use operator for in-repo e2e tests #10132

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

caseydavenport
Copy link
Member

Description

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@caseydavenport caseydavenport requested a review from a team as a code owner April 2, 2025 20:58
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone Apr 2, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 2, 2025
@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Apr 2, 2025
@marvin-tigera marvin-tigera removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 2, 2025
@caseydavenport caseydavenport changed the title [PROTOTYPE] Use operator for in-cluster e2e tests [PROTOTYPE] Use operator for in-repo e2e tests Apr 2, 2025
build/_output/bin/gen-versions -os-versions=../calico_versions.yml > pkg/components/calico.go

# Modify pull policy to be "Never".
find . -name '*.go' | xargs sed -i 's/PullIfNotPresent/PullNever/g'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Member

@coutinhop coutinhop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@caseydavenport caseydavenport changed the title [PROTOTYPE] Use operator for in-repo e2e tests Use operator for in-repo e2e tests Apr 3, 2025
Copy link
Member

@matthewdupre matthewdupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

# the test manifest.
includeCRDs: false
goldmane:
enabled: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've had a lot of recent failures just installing with these components. I expect that will slow down a lot once they're not being as actively tweaked, but I wonder if (as long as they don't blow our compute budget) we should enable them so they're there through the tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! I was planning on doing this as a part 2 follow-on, but could certainly enable from the get-go.

wait_pod_ready -l k8s-app=kube-dns -n kube-system
wait_pod_ready calicoctl -n kube-system
echo "Calico is running."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we easily check the tigerastatus instead of relying on pod readiness?

Doesn't have to be included in this PR, but I think it would be better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could do that instead pretty easily.

@@ -0,0 +1,48 @@
# Components defined here are required to be kept in sync with hack/gen-versions/calico.go.tpl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify "in the tigera/operator repo"; also reference the other spot in the operator repo that's the direct copy paste (config/calico_versions.yml), and update both of those files to refer back here please.

That said, I hope we can remove this copy of this file and will comment elsewhere on that.

# Modify the versions that are in-use to match our locally built images.
pushd operator
make build/_output/bin/gen-versions
build/_output/bin/gen-versions -os-versions=../calico_versions.yml > pkg/components/calico.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if there's a practical way to generate this file from tigera/operator:config/calico_versions.yml.

As it stands there are only relatively minor variations from that file (mostly master vs latest-amd64 but it's not quite a simple swap).

For older branches it's also a little annoying: the operator tends to pin a release version (e.g. v3.28.2), but I guess the intention here is to always use the latest-amd64 tag regardless of what branches are in use? Might be clearer to swap everything to test-build if that's the case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the intention is that the version we build is always going to install the latest images that were built as part of the CI / commit under test.

I think this will work for release-branches as well. We could change how we build / tag images for CI so that they match the ones expected for the operator that is being pulled in - that would allow us to remove this I think?

Well-worth doing IMO, but I think that's a phase 2 task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants